package com.atguigu.order.callback;

import com.atguigu.Product.Product;
import com.atguigu.order.feigin.ProductFeignClient;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class ProductFeignClientFallback implements ProductFeignClient {
    @Override
    public Product getProductById(Long id) {
        System.out.println("CallBack");
        Product product = new Product();
        product.setId(id);
        product.setProductName("商品不存在");
        product.setPrice(new BigDecimal(0));
        product.setNum(0);
        return product;
    }
}
